package com.njym.java.security.app.biz;

import com.njym.java.security.app.entity.FamilyUserGroups;
import com.njym.java.security.app.entity.UserGroupsToUser;
import com.njym.java.security.app.entity.UserGroupsToUserVo;
import com.njym.java.security.app.mapper.FamilyUserGroupsMapper;
import com.njym.java.security.app.mapper.UserGroupsToUserMapper;
import com.njym.java.security.common.biz.BaseBiz;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 
 *
 * @author lijie
 * @email 717057076@qq.com
 * @date 2019-11-22 16:44:11
 */
@Service
public class UserGroupsToUserBiz extends BaseBiz<UserGroupsToUserMapper,UserGroupsToUser> {
    @Resource
    private UserGroupsToUserMapper userGroupsToUserMapper;
    @Resource
    private FamilyUserGroupsMapper familyUserGroupsMapper;

    public List<UserGroupsToUserVo> queryGroup(Integer userId, Integer isFamily){
        return userGroupsToUserMapper.queryGroup(userId, isFamily);
    }

    public int addFamilyGroup(FamilyUserGroups familyUserGroups){
        return familyUserGroupsMapper.addFamilyGroupGetKey(familyUserGroups);
    }

    public List<UserGroupsToUserVo> queryGroupUser(Integer groupId){
        return userGroupsToUserMapper.queryGroupUser(groupId);
    }

    public int quitGroupTo(Integer groupId, Integer userId){
        return userGroupsToUserMapper.quitGroupTo(groupId, userId);
    }

    public int dissolveGroupTo(Integer groupId){
        return userGroupsToUserMapper.dissolveGroupTo(groupId);
    }
}